<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title><?php echo $this->title; ?></title>
	<?php Yii::app()->clientScript->registerCoreScript('jquery');?>
	<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/bootstrap-3.3.4-dist/css/bootstrap.min.css">
	<link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/manage/css/css.css" />
</head>
<body style="padding-top:50px;">
<!--header-->

<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="<?php echo Yii::app()->createUrl('admin'); ?>">后台管理首页</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="javascript:void(0);" id="clear">更新缓存</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
			<?php echo Yii::app()->user->name; ?>
          	 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="<?php echo $this->createUrl('user/changePwd'); ?>">修改密码</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li><a href="<?php echo $this->createUrl('user/logout'); ?>">登出</a></li>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
<!--end header-->

<div class="container-fluid">
	<div class="row">
		<div class="col-sm-3">
		<div class="left">
			<div class="panel-group">
			  
			  <div class="panel panel-default">
			    <div class="panel-heading">
			      <h4 class="panel-title">
			          内容管理
			      </h4>
			    </div>
			      <div class="panel-body" style="display:
			      		<?php 
			      	if(Yii::app()->controller->id == 'default' || Yii::app()->controller->id == 'article' || Yii::app()->controller->id == 'attr' || Yii::app()->controller->id == 'tags'){
			      			echo 'block';
			      		} else {
			      			echo 'none';
			      		} ?>;" >
			        <a href="<?php echo $this->createUrl('article/add'); ?>">添加内容</a>
			        <a href="<?php echo $this->createUrl('article/list');?>">查看文章列表</a>
			        <a href="<?php echo $this->createUrl('attr/list'); ?>">文章属性管理</a>
			        <a href="<?php echo $this->createUrl('tags/list');?>">Tags标签管理</a>
			      </div>
			  </div>

			  <div class="panel panel-default">
			    <div class="panel-heading">
			      <h4 class="panel-title">
			          栏目管理
			      </h4>
			    </div>
			      <div class="panel-body" style="display:<?php if(Yii::app()->controller->id == 'category'){echo 'block';} else {echo 'none';} ?>;" >
			        <a href="<?php echo $this->createUrl('category/add');?>">添加栏目</a>
			        <a href="<?php echo $this->createUrl('category/list');?>">查看栏目列表</a>
			      </div>
			  </div>

			  <div class="panel panel-default">
			    <div class="panel-heading">
			      <h4 class="panel-title">
			        	用户管理
			      </h4>
			    </div>
		      	<div class="panel-body" style="display:<?php if(Yii::app()->controller->id == 'user'){echo 'block';} else {echo 'none';} ?>;" >
			      	<a href="<?php echo $this->createUrl('user/list'); ?>">查看用户列表</a>
					<a href="<?php echo $this->createUrl('user/add');?>">添加管理员</a>
		      	</div>
			  </div>
			  
			  <div class="panel panel-default">
			    <div class="panel-heading">
			      <h4 class="panel-title">
			        	其他
			      </h4>
			    </div>
		      	<div class="panel-body" style="display:
		      	<?php 
		      	if(Yii::app()->controller->id == 'flink' || Yii::app()->controller->id == 'pages'){
		      			echo 'block';
		      		} else {
		      			echo 'none';
		      		} ?>;" >
			      	<a href="<?php echo $this->createUrl('flink/list'); ?>">友情链接</a>
			      	<a href="<?php echo $this->createUrl('pages/list');	?>">单页管理</a>
		      	</div>
			  </div>
			  
			  <div class="panel panel-default">
			    <div class="panel-heading">
			      <h4 class="panel-title">
			        	系统管理
			      </h4>
			    </div>
		      	<div class="panel-body" style="display:<?php if(Yii::app()->controller->id == 'system'){echo 'block';} else {echo 'none';} ?>;" >
			      	<a href="<?php echo $this->createUrl('system/set'); ?>">系统设置</a>
		      	</div>
			  </div>

			</div>
			</div>
		</div>
		<div class="col-sm-9">
			<div class="right">
				<?php echo $content; ?>
			</div>
		</div>
	</div>
</div>

  	<footer class="container-fluid">
  		<div class="row">
  			<div class="col-sm-12 text-center" style="border-top:1px solid #e7e7e7;">
  				<p>
    				技术支持：364129870@qq.com
    			</p>
    		</div>
    	</div>
  	</footer>
	<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/bootstrap-3.3.4-dist/js/bootstrap.min.js"></script>
<script>
	$(function(){
		$('#clear').click(function(){
			$.ajax({
				method : 'post',
				url : '<?php echo Yii::app()->controller->createUrl('system/clear');?>',
				success : function(data){
					alert(data);
				}
			});
		});

		$('.panel-group').find('.panel-heading').click(function(){
			$('.panel-group').find('.panel-body').hide();
			$(this).next().show();
		});
	});
</script>
	</body>
</html>